<template>
  <a-modal
    :visible="visible"
    title="推免预报名信息反馈"
    :width="1200"
    :bodyStyle="{
      'max-height': '76vh',
      overflow: 'auto'
    }"
    style="top: 20px;"
    okText="提交反馈"
    @cancel="() => { $emit('cancel') }"
    @ok="confirm"
  >
    <detail-list :col="4">
      <detail-list-item term="招生年度">{{ defendedInfo.zsnd }}</detail-list-item>
      <detail-list-item term="推免类型">{{ defendedInfo.tmlx }}</detail-list-item>
      <detail-list-item term="报考院系">{{ defendedInfo.zsyx }}</detail-list-item>
      <detail-list-item term="报考专业">{{ defendedInfo.zszy }}</detail-list-item>
      <detail-list-item term="报考导师">{{ defendedInfo.zsds }}</detail-list-item>

      <detail-list-item term="姓名">{{ defendedInfo.xm }}</detail-list-item>
      <detail-list-item term="性别">{{ defendedInfo.xb }}</detail-list-item>
      <detail-list-item term="证件号码">{{ defendedInfo.sfzh }}</detail-list-item>

      <detail-list-item term="出生年月">{{ defendedInfo.csny && getFormatTime(defendedInfo.csny)}}</detail-list-item>
      <detail-list-item term="毕业学校代码">{{ defendedInfo.bydwdm }}</detail-list-item>
      <detail-list-item term="毕业学校名称">{{ defendedInfo.bydwmc }}</detail-list-item>
      <detail-list-item term="毕业专业代码">{{ defendedInfo.byzydm}}</detail-list-item>
      <detail-list-item term="毕业专业名称">{{ defendedInfo.byzymc }}</detail-list-item>
      <detail-list-item term="专业总人数">{{ defendedInfo.byzyzrs }}</detail-list-item>
      <detail-list-item term="专业排名">{{ defendedInfo.zypm }}</detail-list-item>
      <detail-list-item term="外国语水平">{{ defendedInfo.wgysp }}</detail-list-item>
      
      <detail-list-item term="移动电话">{{ defendedInfo.yddh }}</detail-list-item>
      <detail-list-item term="备用手机">{{ defendedInfo.bysj }}</detail-list-item>
      <detail-list-item term="通讯地址">{{ defendedInfo.txdz }}</detail-list-item>
      <detail-list-item term="邮政编码">{{ defendedInfo.yzbm }}</detail-list-item>
      <detail-list-item term="QQ号码">{{ defendedInfo.qqhm }}</detail-list-item>
      <detail-list-item term="报名时间">{{ defendedInfo.bmsj && getFormatTime(defendedInfo.bmsj)}}</detail-list-item>
      <!-- <detail-list-item term="其他信息">{{ defendedInfo.qtxx || defendedInfo.tmly }}</detail-list-item> -->
    </detail-list>
    <detail-list :col="1">
     <detail-list-item term="其他信息"><pre>{{ defendedInfo.qtxx || defendedInfo.tmly }}</pre></detail-list-item> 
     </detail-list>
    <a-form :form="form">
      <a-form-item label="反馈内容">
        <a-textarea style="background: #fff;color: rgba(0,0,0,.65)" maxlength="2000" rows="4" :autosize="false"
                    v-decorator="['yxlxksfkxx',{initialValue:(defendedInfo.yxlxksfkxx?defendedInfo.yxlxksfkxx:'报名成功')}]" />
      </a-form-item>
    </a-form>
  </a-modal>
</template>

<script>
  import {STable} from '~'
  import {mapState} from 'vuex'
  import moment from 'moment'
  import DetailList from '~/tool/DetailList'

  const DetailListItem = DetailList.Item

  export default {
    props: ['visible', 'isCheck'],
    components: {DetailList, DetailListItem, STable},
    data() {
      return {
        form: this.$form.createForm(this),
        defendedInfo: {},
        yxlxksfkxx: null,
      }
    },
    watch: {
      visible(val) {
        if (val) {
          this.form.resetFields()
        }
      }
    },
    computed: {
      ...mapState({})
    },
    created() {

    },
    methods: {
      getFormatTime(time) {
        return moment(time).format('YYYY-MM-DD')
      },
      confirm() {
        this.form.validateFields((err, values) => {
          if (err) {
            return
          }
          let params = Object.assign({}, values, {
            id: this.defendedInfo.id
          })
          this.$api.student.tmybmxxFeedback(params).then(res => {
            this.$message.success(res.msg)
            this.$emit('cancel')
            this.$emit('refresh')
          })
        })
      }
    }
  }
</script>

<style lang='less' scoped>
  .pre-red::before {
    display: inline-block;
    margin-right: 4px;
    content: "*";
    font-family: SimSun;
    line-height: 1;
    font-size: 14px;
    color: #f5222d;
  }
</style>
